- real_page = page["real_page"]
.span6.well
  %h2 
    Latest News
    %a.rss{:href => "#{site.base_url}/news.atom"}
      %i.icon-rss
  - # Match 430px twitter feed 
  %ul.listPosts{:style=>"min-height: 505px"}
    - for post in site.posts[0,4]
      %li
        %span.name{:style=>"color: #292F33;"}= lookup_name(post.author)
        %span.meta{:style=>"color: #292F33;"}= post.date.strftime('%b %d, %Y')
        %a{:href => "#{site.base_url}#{post.url}"}= post.title  
        %br
        - if (post.content.length > 0)
          - cut_at = post.content.index(/<pre[^>]*>/)
          -#%p= summarize(html_to_text(cut_at ? post.content[0,cut_at] : post.content), 50)
          - text = html_to_text(cut_at ? post.content[0, cut_at] : post.content)
          -# might want to use 'white-space: pre-line;' here
          - first_sentence = text.index(/[\.\!]( |$)/)
          - second_sentence = text.index(/[\.\!]( |$)/, [ first_sentence + 1, text.length - 1].min) || text.index(/[ ]/, [ first_sentence + 1, text.length - 1 ].min)
          - summary = text[0..second_sentence]
          %p
            = summary + "..."
    %li
      %a{:href=>"#{site.base_url}/news"} More &raquo;
